Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set body to empty string #479

Merged
merged 4 commits into from
Mar 12, 2024
Merged

set body to empty string #479

merged 4 commits into from
Mar 12, 2024

Conversation

mapsam
Copy link
Contributor

@mapsam mapsam commented Mar 11, 2024

A POST, PUT, PATCH, or DELETE request using got that does not have a body defined will result in a socket timeout as described in #459. This updates the node-interface to set the body to an empty string if none is provided for the relevant methods.

Resolves #459

Refs: sindresorhus/got#2303

I've added a regression test that will result in a timeout if the body is not set properly - here's how it looks prior to the change:

Screen Shot 2024-03-11 at 4 09 18 PM

Copy link

@abhay693 abhay693 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mpothier mpothier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mapsam mapsam merged commit af46a7d into main Mar 12, 2024
4 of 5 checks passed
@mapsam mapsam deleted the mapsam/fix-socket-hangup-delete branch March 12, 2024 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug(regression) - Socket hang up since v0.13.5
3 participants